//-----------------------------------------------------------------------------
// <copyright file="IPlugin.cs" company="Justin Wallace Saunders">
//     Copyright (c) Microsoft Public License. All rights reserved.
// </copyright>
// <author name="Justin Wallace Saunders" email="justinsa@live.ca" />
//-----------------------------------------------------------------------------
namespace Community.Tools.Plugins
{
    using System;
    using System.Collections.Generic;

    /// <summary>
    /// This interface specifies the rudimentary interface that every plugin must implement.
    /// </summary>
    public interface IPlugin
    {
        /// <summary>
        /// Raised when a plugin wants to be Unloaded.
        /// </summary>
        event EventHandler<PluginUnloadEventArgs> PluginUnloadEvent;

        /// <summary>
        /// Gets the name of the plugin. Used as the key in a <code>PluginCollection</code>.
        /// </summary>
        string Name { get; }

        /// <summary>
        /// Initializes the plugin.
        /// </summary>
        void Initialize();

        /// <summary>
        /// Executes the plugin.
        /// </summary>
        /// <param name="arguments">A collection of arguments to be processed.</param>
        void Run(IDictionary<string, object> arguments);

        /// <summary>
        /// Uninitializes the plugin.
        /// </summary>
        void Uninitialize();
    }
}
